<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增老师请假申请')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-apply-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">教师姓名：</label>
                <div class="col-sm-8">
                    <input name="teacherId"  type="hidden"  th:value="${teacher.userId}">
                    <input name="teacherName" class="form-control" type="text" readonly th:value="${teacher.userName}">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">部门名称：</label>
                <div class="col-sm-8">
                    <input name="deptId"  type="hidden"  th:value="${teacher.deptId}">
                    <input name="deptName" class="form-control" type="text" readonly th:value="${teacher.dept.deptName}">
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">申请类型：</label>
                <div class="col-sm-8">
                    <select name="type" th:with="type=${@dict.getType('sc_apply_type')}" required class="form-control">
                        <option value="">请选择</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">请假开始：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="beginTime" class="form-control" placeholder="请输入请假开始时间" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">请假结束：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="endTime" class="form-control" placeholder="请输入请假结束时间" type="text" required>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">请假原因：</label>
                <div class="col-sm-8">
                    <textarea name="reason" class="form-control" type="text" required placeholder="请输入请假原因"></textarea>
                </div>
            </div>
        </form>

    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "school/teacher/apply";
        $("#form-apply-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-apply-add').serialize());
            }
        }

        $("input[name='beginTime']").datetimepicker({
            format: "yyyy-mm-dd HH:mm:ss",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd HH:mm:ss",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>